<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Nfc Info: NdefNfcMimeImageRecord Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="NfcInfo80.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Nfc Info
   
   </div>
   <div id="projectbrief">Shows all information about NFC tags available through Qt Mobility APIs. Includes reusable convenience classes for handling additional tag types: Smart Poster, Image and vCard.</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">NdefNfcMimeImageRecord Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="NdefNfcMimeImageRecord" -->
<p>Handles all image-related MIME media-type constructs.  
 <a href="class_ndef_nfc_mime_image_record.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="ndefnfcmimeimagerecord_8h_source.html">ndefnfcmimeimagerecord.h</a>&gt;</code></p>

<p><a href="class_ndef_nfc_mime_image_record-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad1d7c951f0bb4cf5ed4b8824ffae7919"></a><!-- doxytag: member="NdefNfcMimeImageRecord::NdefNfcMimeImageRecord" ref="ad1d7c951f0bb4cf5ed4b8824ffae7919" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ndef_nfc_mime_image_record.html#ad1d7c951f0bb4cf5ed4b8824ffae7919">NdefNfcMimeImageRecord</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a new Mime/Image record using the default type (png) and an empty payload. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afa54d381a0bf69263ad911148ce73e39"></a><!-- doxytag: member="NdefNfcMimeImageRecord::NdefNfcMimeImageRecord" ref="afa54d381a0bf69263ad911148ce73e39" args="(const QNdefRecord &amp;other)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ndef_nfc_mime_image_record.html#afa54d381a0bf69263ad911148ce73e39">NdefNfcMimeImageRecord</a> (const QNdefRecord &amp;other)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new Mime/Image record based on the record passed through the argument. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5f0d056b3f5120849e7a6d0aa59bd56c"></a><!-- doxytag: member="NdefNfcMimeImageRecord::NdefNfcMimeImageRecord" ref="a5f0d056b3f5120849e7a6d0aa59bd56c" args="(const QByteArray &amp;mimeType)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ndef_nfc_mime_image_record.html#a5f0d056b3f5120849e7a6d0aa59bd56c">NdefNfcMimeImageRecord</a> (const QByteArray &amp;mimeType)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new Mime/Image record using the specified mime type and an empty payload. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ndef_nfc_mime_image_record.html#aa4f632ecf03012c2b73adcf247030185">NdefNfcMimeImageRecord</a> (const QImage &amp;img, const QByteArray &amp;mimeType)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new Mime/Image record using the pixel data of the <em>img</em>, converted and encoded in the specified mime type (if supported).  <a href="#aa4f632ecf03012c2b73adcf247030185"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QByteArray&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ndef_nfc_mime_image_record.html#a0e5ca993bb4140ff0e53e14249537a94">format</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the Qt image format of the image data stored in the payload.  <a href="#a0e5ca993bb4140ff0e53e14249537a94"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QByteArray&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ndef_nfc_mime_image_record.html#a9cb7f5402288b0f75f5108f4fc0d5909">mimeType</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">return the mime type of the image, as set in the record type.  <a href="#a9cb7f5402288b0f75f5108f4fc0d5909"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QImage&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ndef_nfc_mime_image_record.html#a16f8b0024f302ee76eafa0a9aa631dac">image</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Decode the payload and return it as a pixel image (QImage).  <a href="#a16f8b0024f302ee76eafa0a9aa631dac"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QByteArray&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ndef_nfc_mime_image_record.html#a26d7c8aeef20e73f0698fb28810e78d2">imageRawData</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the raw data of the image.  <a href="#a26d7c8aeef20e73f0698fb28810e78d2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ndef_nfc_mime_image_record.html#a04abfb8145f186bc35ee34b0637ca8f4">setImage</a> (QByteArray &amp;imageRawData)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the image (= payload) of the record to the byte array. This allows passing an encoded image (e.g., png) directly to the class.  <a href="#a04abfb8145f186bc35ee34b0637ca8f4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ndef_nfc_mime_image_record.html#a5041d9f2924a4e754b9385b783842f06">setImage</a> (const QImage &amp;image, const QByteArray &amp;mimeType)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode the image data into the payload using the specified mime type.  <a href="#a5041d9f2924a4e754b9385b783842f06"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Handles all image-related MIME media-type constructs. </p>
<p>Reads all images supported by Qt and is able to return those as a QImage instance. When writing the raw pixel data of a QImage to this record, you can choose the MIME type to use for encoding the image. Again, all image formats supported by Qt for writing can be used; in practical scenarios, mostly png, gif and jpeg will make sense.</p>
<p>The <a class="el" href="class_ndef_nfc_mime_image_record.html" title="Handles all image-related MIME media-type constructs.">NdefNfcMimeImageRecord</a> class handles all supported images and therefore many different record types. To simplify the use, there is no extra class for each individual image type (image/png, gif, jpg, jpeg, etc.). Therefore, the isRecordType&lt;&gt;() method can't be used with this generic image handler class. Instead, check if the type name format is Mime and the record type starts with "image/" - if this is the case, create an instance of the <a class="el" href="class_ndef_nfc_mime_image_record.html" title="Handles all image-related MIME media-type constructs.">NdefNfcMimeImageRecord</a> based on the generic record. Example:</p>
<p>if (record.typeNameFormat() == QNdefRecord::Mime &amp;&amp; record.type().startsWith("image/")) { <a class="el" href="class_ndef_nfc_mime_image_record.html" title="Handles all image-related MIME media-type constructs.">NdefNfcMimeImageRecord</a> imgRecord(record); QImage img = imgRecord.image(); }</p>
<dl class="version"><dt><b>Version:</b></dt><dd>1.0.0 </dd></dl>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aa4f632ecf03012c2b73adcf247030185"></a><!-- doxytag: member="NdefNfcMimeImageRecord::NdefNfcMimeImageRecord" ref="aa4f632ecf03012c2b73adcf247030185" args="(const QImage &amp;img, const QByteArray &amp;mimeType)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NdefNfcMimeImageRecord::NdefNfcMimeImageRecord </td>
          <td>(</td>
          <td class="paramtype">const QImage &amp;&#160;</td>
          <td class="paramname"><em>img</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QByteArray &amp;&#160;</td>
          <td class="paramname"><em>mimeType</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create a new Mime/Image record using the pixel data of the <em>img</em>, converted and encoded in the specified mime type (if supported). </p>
<p>The mime type can either be a Qt image format or a mime type - the method will automatically convert to a mime type (</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_ndef_nfc_mime_image_record.html#a04abfb8145f186bc35ee34b0637ca8f4" title="Set the image (= payload) of the record to the byte array. This allows passing an encoded image (e...">setImage()</a> ). </dd></dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a0e5ca993bb4140ff0e53e14249537a94"></a><!-- doxytag: member="NdefNfcMimeImageRecord::format" ref="a0e5ca993bb4140ff0e53e14249537a94" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QByteArray NdefNfcMimeImageRecord::format </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Retrieve the Qt image format of the image data stored in the payload. </p>
<dl class="see"><dt><b>See also:</b></dt><dd>QImageReader::imageFormat() </dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the Qt image format of the payload. </dd></dl>

</div>
</div>
<a class="anchor" id="a16f8b0024f302ee76eafa0a9aa631dac"></a><!-- doxytag: member="NdefNfcMimeImageRecord::image" ref="a16f8b0024f302ee76eafa0a9aa631dac" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QImage NdefNfcMimeImageRecord::image </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Decode the payload and return it as a pixel image (QImage). </p>
<p>If the payload is empty or Qt cannot parse the decode the image format, an empty image is returned.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the decoded image if possible, or an empty image otherwise. </dd></dl>

</div>
</div>
<a class="anchor" id="a26d7c8aeef20e73f0698fb28810e78d2"></a><!-- doxytag: member="NdefNfcMimeImageRecord::imageRawData" ref="a26d7c8aeef20e73f0698fb28810e78d2" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QByteArray NdefNfcMimeImageRecord::imageRawData </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the raw data of the image. </p>
<p>No decoding is performed, so this will retrieve the encoded version of the image (e.g., a png). This equals retrieving the payload. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the encoded image / payload of the record. </dd></dl>

</div>
</div>
<a class="anchor" id="a9cb7f5402288b0f75f5108f4fc0d5909"></a><!-- doxytag: member="NdefNfcMimeImageRecord::mimeType" ref="a9cb7f5402288b0f75f5108f4fc0d5909" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QByteArray NdefNfcMimeImageRecord::mimeType </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>return the mime type of the image, as set in the record type. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the mime type of the record. </dd></dl>

</div>
</div>
<a class="anchor" id="a04abfb8145f186bc35ee34b0637ca8f4"></a><!-- doxytag: member="NdefNfcMimeImageRecord::setImage" ref="a04abfb8145f186bc35ee34b0637ca8f4" args="(QByteArray &amp;imageRawData)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool NdefNfcMimeImageRecord::setImage </td>
          <td>(</td>
          <td class="paramtype">QByteArray &amp;&#160;</td>
          <td class="paramname"><em>imageRawData</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the image (= payload) of the record to the byte array. This allows passing an encoded image (e.g., png) directly to the class. </p>
<p>The method will attempt to identify the mime type of the raw image data and automatically modify the mime type stored in the record if successful. If this is not possible or the passed byte array is empty, the payload will not be set. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">imageRawData</td><td>the encoded image data to use as payload of the record. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a5041d9f2924a4e754b9385b783842f06"></a><!-- doxytag: member="NdefNfcMimeImageRecord::setImage" ref="a5041d9f2924a4e754b9385b783842f06" args="(const QImage &amp;image, const QByteArray &amp;mimeType)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool NdefNfcMimeImageRecord::setImage </td>
          <td>(</td>
          <td class="paramtype">const QImage &amp;&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QByteArray &amp;&#160;</td>
          <td class="paramname"><em>mimeType</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Encode the image data into the payload using the specified mime type. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td>the pixel image data to encode and set as the payload. </td></tr>
    <tr><td class="paramname">mimeType</td><td>the mime type can either be specified using a supported mime type or a Qt image format. The image format is automatically converted to a mime type. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="ndefnfcmimeimagerecord_8h_source.html">ndefnfcmimeimagerecord.h</a></li>
<li>ndefnfcmimeimagerecord.cpp</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Mon Aug 29 2011 22:30:51 for Nfc Info by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
